<template>
    <div class="header">
        <i class="iconfont icon-fanhui" v-if="iconShow==1" @click="iconClick"></i>
        {{title}}
        <slot name="icon"></slot>
    </div>
</template>
<script>
export default {
    name: 'header',
    props: ['title', 'iconShow'],
    methods: {
        iconClick() {
            if(this.$route.query.history&&this.$route.query.history==1){
                this.$router.push({path:'/main/home'});
            }else{
                this.$router.go(-1);
            }
            
        }
    }
}
</script>
<style lang="scss">
@import '../scss/variable/base.scss';
.header {
    background: -webkit-linear-gradient(top, #3ac9d1, #77eedf);
    position: fixed;
    top: 0;
    z-index: 10;
    width: 100%;
    height: 1.2rem;
    // background: $primaryColor;
    color: #fff;
    text-align: center;
    font-size: 0.42rem;
    line-height: 1.2rem;
    .icon-fanhui {
        position: absolute;
        left: 0.4rem;
        color: #fff;
    }
    .icon-wenhao {
        position: absolute;
        right: 0;
        margin-right: 0.4rem;
        font-size: 0.6rem;
    }
}
</style>


